function [R_2,SST,SSE,SSR] = getR(y,y_hat)

SST=sumsqr(y-mean(y));
SSE=sumsqr(y-y_hat);
SSR=sumsqr(y_hat-mean(y));
R_2=1-SSE/SST;

end

